package org.example.fail;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;

public class BuyFallBack {

    // sentinel 回退
    public static ResponseEntity<String> buyBlock(@PathVariable String name, @PathVariable Integer count, BlockException e) {
        return ResponseEntity.ok(String.format("【进入 BuyFallBack 方法】购买%d份%s 失败，当前购买人数过多，请稍后再试", count, name));
    }
}
